using System;

namespace Servlets.Api
{
	/// <summary>
	/// Used to control the flow of a request
	/// </summary>
	public interface IRequestDispatcher
	{
		/// <summary>
		/// Adds the url and request to the request queue.
		/// The added request is called when the calling method returns.
		/// </summary>
		/// <param name="url">
		/// A <see cref="System.String"/>. The URL of the page to be forwarded to beginning with a "/".
		/// If this url does not exist, the response stream will be cleared and the default 404 error page will be shown.
		/// </param>
		void Forward(string url);
		
		/// <summary>
		/// Sends control over to the servlet mapped to the given url.
		/// </summary>
		/// <param name="url">
		/// A <see cref="System.String"/>
		/// </param>
		/// <param name="request">
		/// A <see cref="IRequest"/>
		/// </param>
		/// <param name="response">
		/// A <see cref="IResponse"/>
		/// </param>
		void Include(string url, IRequest request, IResponse response);
	}
}